package com.yincb.service;

import com.yincb.entity.Account;
import com.yincb.entity.User;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UAService {


    @Resource
    private AccountService accountService;

    @Resource
    private UserService userService;


    public void query() {

        List<Account> select = accountService.select();

        List<User> select1 = userService.select();


        System.out.println(select);

        System.out.println(select1);

    }


    public void add() {
        User user = new User();
        user.setId(2L);
        user.setName("BO");
        userService.insert(user);


        Account account = new Account();
        account.setUserId(2L);
        account.setMoney(20D);
        accountService.insert(account);



    }

}
